#ifndef __SIDCPTP_H__
#define __SIDCPTP_H__
#include "initio.h"

// dps handle
#define DPS_HREQUEST_HND		(DPS_MASK_HAND |(UINT32)DPS_HREQUEST_INDEX)//0x7FFFFF06
#define DPS_HRSPONSE_HND		(DPS_MASK_HAND |(UINT32)DPS_HRSPONSE_INDEX)//0x7FFFFF05
#define DPS_DREQUEST_HND		(DPS_MASK_HAND |(UINT32)DPS_DREQUEST_INDEX)//0x7FFFFF04
#define DPS_DRSPONSE_HND		(DPS_MASK_HAND |(UINT32)DPS_DRSPONSE_INDEX)//0x7FFFFF03
#define DPS_HDISCVRY_HND		(DPS_MASK_HAND |(UINT32)DPS_HDISCVRY_INDEX)//0x7FFFFF02
#define DPS_DDISCVRY_HND		(DPS_MASK_HAND |(UINT32)DPS_DDISCVRY_INDEX)//0x7FFFFF01 

#define DPS_MASK_HAND			0x7FFFFF00
#define DPS_MASK_HAND_		0x000000ff

// G_dpsObjIndex
extern xdata UINT8 G_dpsObjIndex;

#define DPS_MAX_INDEX				0x07
#define DPS_HREQUEST_INDEX		0x06
#define DPS_HRSPONSE_INDEX		0x05
#define DPS_DREQUEST_INDEX		0x04
#define DPS_DRSPONSE_INDEX		0x03
#define DPS_HDISCVRY_INDEX			0x02
#define DPS_DDISCVRY_INDEX			0x01
#define DPS_NULL_INDEX				0x00

#define PTP_Mask_ObjIndex			0x0f
#define PTP_Mask_ObjInfo			0x10
#define PTP_Mask_Request			0x20

#define PTP_getObjIndex_Form_Handle(handle) 	((UINT8)handle)
#define PTP_getObjIndex() 			(G_dpsObjIndex &PTP_Mask_ObjIndex) 
#define PTP_getObjInfo()				(G_dpsObjIndex &PTP_Mask_ObjInfo) 
#define PTP_getRequest()				(G_dpsObjIndex &PTP_Mask_Request) 

#define PTP_addMask_ObjInfo()		G_dpsObjIndex |= PTP_Mask_ObjInfo
#define PTP_addMask_Request()		G_dpsObjIndex |= PTP_Mask_Request

#define PTP_removeMask_ObjInfo()	G_dpsObjIndex &= (~PTP_Mask_ObjInfo)
#define PTP_removeMask_Request()	G_dpsObjIndex &= (~PTP_Mask_Request)

#define PTP_setObjIndex(handle) 			G_dpsObjIndex = ((UINT8)handle |PTP_getRequest())
#define PTP_setNull()						G_dpsObjIndex = DPS_NULL_INDEX

#define PTP_clearObjIndex()				G_dpsObjIndex&= (~PTP_Mask_ObjIndex)

#define PTP_isToDoMain()				((!PTP_getObjInfo() ) &&( PTP_getObjIndex())) 



void SIDC_GetScriptInfo(UINT32 *handle,UINT8 *name);
void dps_makeFileNode(UINT32 handle,UINT32 fileSize);
void  USBSIDC_BoSendEvent(	UINT32 eventCode,	UINT32 param0,	UINT32 param1,	UINT32 param2);
#endif
